<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.entity.TermLink.setKey</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d4/d8b/classnars_1_1entity_1_1TermLink_ad19e927a3e2e339682081d8e462fe73b.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="ad19e927a3e2e339682081d8e462fe73b"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void nars.entity.TermLink.setKey </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Set the key of the link. </p>

<p>Definition at line <a class="el" href="../../db/daa/TermLink_8java_source.html#l00118">118</a> of file <a class="el" href="../../db/daa/TermLink_8java_source.html">TermLink.java</a>.</p>

<p>References <a class="el" href="../../d9/de0/Item_8java_source.html#l00034">nars.entity.Item.key</a>, <a class="el" href="../../db/daa/TermLink_8java_source.html#l00056">nars.entity.TermLink.target</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00093">nars.io.Symbols.TO_COMPONENT_1</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00094">nars.io.Symbols.TO_COMPONENT_2</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00095">nars.io.Symbols.TO_COMPOUND_1</a>, <a class="el" href="../../d5/da0/Symbols_8java_source.html#l00096">nars.io.Symbols.TO_COMPOUND_2</a>, and <a class="el" href="../../db/daa/TermLink_8java_source.html#l00058">nars.entity.TermLink.type</a>.</p>

<p>Referenced by <a class="el" href="../../d3/dce/TaskLink_8java_source.html#l00051">nars.entity.TaskLink.TaskLink()</a>, and <a class="el" href="../../db/daa/TermLink_8java_source.html#l00104">nars.entity.TermLink.TermLink()</a>.</p>
<div class="fragment"><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;                            {</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        String at1, at2;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">if</span> ((<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">type</a> % 2) == 1) {  <span class="comment">// to component</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            at1 = Symbols.TO_COMPONENT_1;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            at2 = Symbols.TO_COMPONENT_2;</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;        } <span class="keywordflow">else</span> {                <span class="comment">// to compound</span></div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;            at1 = Symbols.TO_COMPOUND_1;</div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;            at2 = Symbols.TO_COMPOUND_2;</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        }</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;        String in = <span class="stringliteral">&quot;T&quot;</span> + <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">type</a>;</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">index</a> != null) {</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">index</a>.length; i++) {</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;                in += <span class="stringliteral">&quot;-&quot;</span> + (<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">index</a>[i] + 1);</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;            }</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        }</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        <a class="code" href="../../d1/dd1/classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600.html#a1487af4a10f874c370c913d9ef784600">key</a> = at1 + in + at2;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a63d15c2000a8634cf4d31e2ede492251.html#a63d15c2000a8634cf4d31e2ede492251">target</a> != null) {</div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            <a class="code" href="../../d1/dd1/classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600.html#a1487af4a10f874c370c913d9ef784600">key</a> += <a class="code" href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a63d15c2000a8634cf4d31e2ede492251.html#a63d15c2000a8634cf4d31e2ede492251">target</a>;</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;        }</div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600_html_a1487af4a10f874c370c913d9ef784600"><div class="ttname"><a href="../../d1/dd1/classnars_1_1entity_1_1Item_a1487af4a10f874c370c913d9ef784600.html#a1487af4a10f874c370c913d9ef784600">nars.entity.Item.key</a></div><div class="ttdeci">String key</div><div class="ttdoc">The key of the Item, unique in a Bag. </div><div class="ttdef"><b>Definition:</b> <a href="../../d9/de0/Item_8java_source.html#l00034">Item.java:34</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a63d15c2000a8634cf4d31e2ede492251_html_a63d15c2000a8634cf4d31e2ede492251"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a63d15c2000a8634cf4d31e2ede492251.html#a63d15c2000a8634cf4d31e2ede492251">nars.entity.TermLink.target</a></div><div class="ttdeci">Term target</div><div class="ttdoc">The linked Term. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00056">TermLink.java:56</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7_html_a2356ada181399f3c6db60308dbb523f7"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a2356ada181399f3c6db60308dbb523f7.html#a2356ada181399f3c6db60308dbb523f7">nars.entity.TermLink.index</a></div><div class="ttdeci">short[] index</div><div class="ttdoc">The index of the component in the component list of the compound, may have up to 4 levels...</div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00060">TermLink.java:60</a></div></div>
<div class="ttc" id="classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48_html_a83725fe12a973c0181d3143ed4622f48"><div class="ttname"><a href="../../d4/d8b/classnars_1_1entity_1_1TermLink_a83725fe12a973c0181d3143ed4622f48.html#a83725fe12a973c0181d3143ed4622f48">nars.entity.TermLink.type</a></div><div class="ttdeci">short type</div><div class="ttdoc">The type of link, one of the above. </div><div class="ttdef"><b>Definition:</b> <a href="../../db/daa/TermLink_8java_source.html#l00058">TermLink.java:58</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d8b/classnars_1_1entity_1_1TermLink_ad19e927a3e2e339682081d8e462fe73b_ad19e927a3e2e339682081d8e462fe73b_icgraph.svg" width="444" height="88"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../db/dec/namespacenars_1_1entity.html">entity</a></li><li class="navelem"><a class="el" href="../../d4/d8b/classnars_1_1entity_1_1TermLink.html">TermLink</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
